val () = Control.Print.printDepth:=1000
val () = Control.Print.printLength:=1000

(* present type by string *)

structure SymTab = SymTabFun(type T=string)

open SymTab

val test=
    let val _ = insert ("x","int")
	val _ = insert ("y","int")
	val _ = beginScope()
	val _ = insert ("x","char")
	val local_x = lookup "x"
	val _ = endScope();
	val global_x = lookup "x"
    in 
	(local_x,global_x)
    end


(* present type by "Type" *)
datatype Type = Int | Char | Array of int*Type | Struct of string | Pointer of Type

structure SymTab = SymTabFun(type T=Type)

open SymTab

val test=
    let val _ = insert ("x",Int)
	val _ = insert ("y",Int)
	val _ = beginScope()
	val _ = insert ("x",Pointer(Array(5,Int)))
	val local_x = lookup "x"
	val _ = endScope();
	val global_x = lookup "x"
    in 
	(local_x,global_x)
    end
